<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>登录页面</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.js"></script>
        <script type="text/javascript">
            function login() {
                var user=$("#user").val();
                var pwd=$("#pwd").val();
                $.post("/forum/index.php/user/login/login",{"user":user,"pwd":pwd},function (data) {
                    if(data==="success"){
                        alert("登录成功！");
                        window.history.go(-1);
                    } else {
                        alert("用户名或密码错误！");
                    }
                })
            }
        </script>
    </head>
    <body>
            用户名：<input type="text" id="user">
            <br><br>
            密码：<input type="password" id="pwd">
            <br><br>
            <button onclick="login()">登录</button>
    </body>
</html>
